let obj = {
    a: 1,
    b: {
        n:2
    }
}

function clone (obj) {
    let clone = Object.create(obj)
    clone.c = 3
    return clone
}

let obj2 = clone(obj)
console.log(obj2);

// let newObj = Object.create(obj)  // 1. {}     2. {}.__proto__ = obj
// let newObj2 = Object.create(obj)
// newObj.b.n = 20
// console.log(newObj2.a);
// console.log(newObj2.b.n);

